﻿<?xml version="1.0" encoding="utf-8" ?>
<xs:schema
    targetNamespace="http://mvcsitemap.codeplex.com/schemas/MvcSiteMap-File-2.0"
    elementFormDefault="qualified"
    xmlns="http://mvcsitemap.codeplex.com/schemas/MvcSiteMap-File-2.0"
    xmlns:xs="http://www.w3.org/2001/XMLSchema">

  <xs:annotation>
    <xs:documentation>
      <!-- _locID_text="Description" _locComment="This string is displayed as a Intellisense tooltip. {Placeholder='XmlSiteMapProvider', 'SiteMap'}" -->MvcSiteMapProvider SiteMap File Schema
    </xs:documentation>

  </xs:annotation>

  <xs:complexType name="mvcSiteMapNodeType">
    <xs:choice minOccurs="0" maxOccurs="unbounded">
      <xs:element name="mvcSiteMapNode" type="mvcSiteMapNodeType" />
    </xs:choice>
    <xs:attributeGroup ref="urlNodeAttributes" />
    <xs:attributeGroup ref="providerNodeAttributes" />
    <xs:attributeGroup ref="fileNodeAttributes" />
    <xs:attributeGroup ref="frequencyNodeAttributes" />
    <xs:anyAttribute processContents="skip" />
  </xs:complexType>

  <xs:complexType name="mvcSiteMapType">
    <xs:choice minOccurs="0" maxOccurs="1">
      <xs:element name="mvcSiteMapNode" type="mvcSiteMapNodeType"/>
    </xs:choice>
    <xs:attributeGroup ref="siteMapAttributes" />
  </xs:complexType>

  <xs:element name="mvcSiteMap" type="mvcSiteMapType" />

  <xs:attributeGroup name="urlNodeAttributes">
    <xs:attribute name="key" type="xs:string" use="optional" />
    <xs:attribute name="url" type="xs:anyURI" use="optional" />
    <xs:attribute name="title" type="xs:string" use="optional" />
    <xs:attribute name="description" type="xs:string" use="optional" />
    <xs:attribute name="area" type="xs:string" use="optional" />
    <xs:attribute name="controller" type="xs:string" use="optional" />
    <xs:attribute name="action" type="xs:string" use="optional" />
    <xs:attribute name="roles" type="xs:string" use="optional" />
    <xs:attribute name="resourceKey" type="xs:string" use="optional" />
    <xs:attribute name="clickable" type="xs:boolean" default="true" use="optional" />
    <xs:attribute name="dynamicNodeProvider" type="xs:string" use="optional" />
    <xs:attribute name="urlResolver" type="xs:string" use="optional" />
    <xs:attribute name="visibilityProvider" type="xs:string" use="optional" />
    <xs:attribute name="targetFrame" type="xs:string" use="optional" />
    <xs:attribute name="imageUrl" type="xs:string" use="optional" />
  </xs:attributeGroup>

  <xs:attributeGroup name="fileNodeAttributes">
    <xs:attribute name="siteMapFile" type="xs:string" use="optional" />
    <xs:attribute name="securityTrimmingEnabled" type="small_boolean_Type" default="false" />
  </xs:attributeGroup>

  <xs:attributeGroup name="providerNodeAttributes">
    <xs:attribute name="provider" type="xs:string" use="optional" />
  </xs:attributeGroup>

  <xs:attributeGroup name="frequencyNodeAttributes">
    <xs:attribute name="lastModifiedDate" type="xs:dateTime" use="optional" />
    <xs:attribute name="changeFrequency" type="changefrequency_type" default="Undefined" use="optional" />
    <xs:attribute name="updatePriority" type="updatepriority_type" default="Undefined" use="optional" />
  </xs:attributeGroup>

  <xs:attributeGroup name="siteMapAttributes">
    <xs:attribute name="enableLocalization" type="small_boolean_Type" default="false" use="optional" />
  </xs:attributeGroup>

  <xs:simpleType name="small_boolean_Type">
    <xs:restriction base="xs:NMTOKEN">
      <xs:enumeration value="false" />
      <xs:enumeration value="true" />
    </xs:restriction>
  </xs:simpleType>

  <xs:simpleType name="changefrequency_type">
    <xs:restriction base="xs:NMTOKEN">
      <xs:enumeration value="Undefined" />
      <xs:enumeration value="Always" />
      <xs:enumeration value="Never" />
      <xs:enumeration value="Hourly" />
      <xs:enumeration value="Daily" />
      <xs:enumeration value="Weekly" />
      <xs:enumeration value="Monthly" />
      <xs:enumeration value="Yearly" />
    </xs:restriction>
  </xs:simpleType>

  <xs:simpleType name="updatepriority_type">
    <xs:restriction base="xs:NMTOKEN">
      <xs:enumeration value="Undefined" />
      <xs:enumeration value="Automatic" />
      <xs:enumeration value="Low" />
      <xs:enumeration value="Normal" />
      <xs:enumeration value="High" />
      <xs:enumeration value="Critical" />
    </xs:restriction>
  </xs:simpleType>
</xs:schema>